$(function(){
    function changeViewTime(outtime,parentSelector){
        var second=outtime%60;
        $(parentSelector+' .viewtime-second').text(second);
        var minute=(outtime-second)/60%60;
        $(parentSelector+' .viewtime-minute').text(minute);
        var hour=(outtime-second-minute*60)/3600%24;
        $(parentSelector+' .viewtime-hour').text(hour);
        var day=(outtime-second-minute*60-hour*3600)/3600/24;
        $(parentSelector+' .viewtime-day').text(day);
        if(outtime<=0){
            return;
        }
        outtime--;
        setTimeout(function(){
            changeViewTime(outtime,parentSelector);
        },1000);
    }
    window.changeViewTime=changeViewTime;
})
